/************************************************************************
 * @file ConfigPanel.cpp
 * @author Ian Chen
 * @version 1.0
 *
 * @section LICENSE
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 3 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
 * General Public License for more details at
 * http://www.gnu.org/licenses/lgpl.html
 *
 ************************************************************************/
#include <pluginui/widget/ConfigPanel.h>

namespace antu
{
namespace plugin
{
namespace ui
{
ConfigPanel::ConfigPanel(QWidget* parent)
    : QWidget(parent),
      m_bContentChanged(false),
      m_ulContentHash(0)
{
}

ConfigPanel::~ConfigPanel()
{

}

void ConfigPanel::save() const
{

}

void ConfigPanel::load()
{

}

bool ConfigPanel::contentHashChanged()
{
    quint64 hash = this->computeContentHash();

    if (this->m_ulContentHash == 0)
    {
        this->m_ulContentHash = hash;
        this->m_bContentChanged = true;
    }
    else
    {
        this->m_bContentChanged = (this->m_ulContentHash == hash) ? false : true;
        this->m_ulContentHash = hash;
    }
    return this->m_bContentChanged;
}

void ConfigPanel::reset()
{
    this->m_ulContentHash = this->computeContentHash();
    this->m_bContentChanged = false;
}

}
}
}

